<template>
  <EleTableComp :config="config">
    <template v-slot:costomLook="slotData">
      <reform-look :data="slotData.data"></reform-look>
    </template>
    <template v-slot:costomCheck="slotData">
      <reform-check :data="slotData.data"></reform-check>
    </template>
  </EleTableComp>
</template>
<script>
import EleTableComp from "@/components/EleTableComp";
import { typeJson } from "@/components/EleTableComp/config";
import reformLook from "./reformLook";
import reformCheck from "./reformCheck";
export default {
  data() {
    return {
      config: {
        header: {
          //breadcrumb: `隐患核查`,
          addButton: false,
          search: [
            {
              type: "datePicker",
              value: "",
              prop: "startDate",
              label: "发现时间",
            },
            {
              type: "datePicker",
              value: "",
              prop: "endDate",
              label: "至",
            },
            {
              type: "dropDown",
              prop: "level",
              value: "",
              label: "隐患级别",
              list: typeJson.level,
            },
            {
              label: "隐患来源",
              prop: "source",
              type: "dropDown",
              list: typeJson.source,
              value: "",
            },
            {
              label: "隐患发现方式",
              prop: "discoverWay",
              type: "dropDown",
              list: typeJson.riskRule,
              value: "",
            },
          ],
        },
        table: [
          {
            type: "index",
          },
          {
            label: "隐患描述",
            prop: "content",
            value: "",
            addEditType: "textArea",
            required: true,
             hidden:true,
          },
          {
            label: "来源",
            prop: "source",
            type: "dropDown",
            addEditType: "dropDown",
            list: typeJson.source,
            value: "",
            required: true,
          },
          {
            label: "隐患部位",
            prop: "part",
          hidden:true,
            value: "",
          },
          {
            label: "级别",
            prop: "level",
            type: "dropDown",
            addEditHidden: "dropDown",
            list: typeJson.level,
            value: "",
            required: true,
          },
          {
            label: "发现方式",
            prop: "discoverWay",
            type: "dropDown",
            addEditHidden: true,
            list: typeJson.riskRule,
           hidden:true,
            value: "",
          },
          {
            label: "发现人",
            prop: "discoverPerson",
            value: "",
            required: true,
          },
          {
            label: "发现时间",
            prop: "discoverDate",
            value: "",
            addEditType: "timePicker",
            required: true,
          },
          {
            label: "核查时间",
            prop: "verifyDate",
            value: "",
            addEditType: "timePicker",
          },
          {
            label: "核查状态",
            prop: "verifyStatus",
            type: "dropDown",
            addEditHidden: true,
            list: typeJson.verifyStatus,
            value: "",
          },
          {
            label: "整改类型",
            prop: "rectifyType",
            addEditType: "dropDown",
            type: "dropDown",
            addEditHidden: true,
            list: typeJson.rectifyType,
            value: "",
          },
          {
            label: "整改方式",
            prop: "rectifyWay",
            type: "dropDown",
            list: typeJson.rectifyWay,
            addEditHidden: true,
            value: "",
             hidden:true,
          },
          {
            label: "整改期限",
            prop: "rectifyExpires",
            addEditHidden: true,
            value: "",
          },
          {
            label: "整改负责人",
            prop: "rectifyPerson",
            value: "",
            addEditHidden: true,
          },
          {
            label: "联系电话",
            prop: "phone",
            value: "",
            addEditHidden: true,
          },
          {
            label: "整改完成日期",
            prop: "rectifyFinishDate",
            value: "",
            addEditHidden: true,
          },
          {
            label: "整改状态",
            prop: "rectifyStatus",
            type: "dropDown",
            list: typeJson.rectifyStatus,
            addEditHidden: true,
            value: "",
          },
          {
            label: "复查时间",
            prop: "reviewDate",
            value: "",
          },
          {
            label: "复查人或单位",
            prop: "reviewMan",
            addEditHidden: true,
            value: "",
             hidden:true,
          },
          {
            label: "复查状态",
            prop: "reviewStatus",
            type: "dropDown",
            list: typeJson.reviewStatus,
            addEditHidden: true,
            value: "",
          },
          {
            label: "操作",
            prop: "", // 传数据的时候 忽略
            type: "operation",
            addEditHidden: true,
            isParam: false,
            edit: false,
            delete: false,
            look: false,
            slotName: ["costomLook", "costomCheck"],
          },
        ],
        select: {
          url: "/app/riskExcludeNew/getList",
          method: "POST",
          mineId: true,
          currentPage: 1,
          pageSize: 10,
          params: {
            checkType: 2,
          },
        },
      },
    };
  },
  components: {
    EleTableComp,
    reformCheck,
    reformLook,
  },
};
</script>
